# GRUB boot loader configuration
# NOTE: ipatch, make sure rebuild grub exe after making changes

GRUB_DEFAULT="0"
GRUB_TIMEOUT="10"
GRUB_DISTRIBUTOR="Arch"
# NOTE: ipatch, `nomodeset` required for loading nvidia proprietary video drivers
GRUB_CMDLINE_LINUX_DEFAULT="BOOT_IMAGE=/vmlinuz-linux root=UUID=1903d681-2020-48f4-8995-8570fbb80fbc rw loglevel=3 quiet nomodeset nvidia-drm.modeset=1 intel_iommu=on"
# GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet ibt=off i915.lvds_channel_mode=2 i915.modeset=0 i915.lvds_use_ssc=0"
#
# NOTE: ipatch, add below settings for macbook pro 11,3
# i915.lvds_channel_mode=2 i915.modeset=0 i915.lvds_use_ssc=0

# NOTE: ipatch, enable below setting on cmdline for qemu pci passthrough on intel
# intel_iommu=on

#
# NOTE: ipatch, attempt to enable DRM with nvidia non-free driver
# ref: https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting
# nvidia_drm.modeset=1
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK="y"

# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE="menu"

# NOTE: ipatch, set a more sane default font for my mbp retina screen
# GRUB_FONT="/path/to/fontfile.pf2"

# Uncomment to use basic console
GRUB_TERMINAL_INPUT="console"

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT="console"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `videoinfo'
GRUB_GFXMODE="auto"
# NOTE: ipatch, per arch wiki
# GRUB_GFXMODE=1024x768x32

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX="keep"

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID="true"

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
# export GRUB_COLOR_NORMAL="light-blue/black"
# export GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

# Uncomment to get a beep at GRUB start
GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
GRUB_SAVEDEFAULT="false"

# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU="y"

# Probing for other operating systems is disabled for security reasons. Read
# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this
# functionality install os-prober and uncomment to detect and include other
# operating systems.
#GRUB_DISABLE_OS_PROBER="false"


GRUB_DISABLE_LINUX_RECOVERY="true"


GRUB_FONT="/boot/grub/unicode.pf2"
